import 'package:json_annotation/json_annotation.dart';

part 'store.g.dart';

@JsonSerializable()
class StoreModel {
  /// 店铺头像
  String headerImg;

  /// 店铺名称
  String storeName;

  /// 评分
  double score;

  /// 月销售
  int monthSales;

  /// 人均价格
  int avgPrice;

  /// 起送价格
  int deliveryPrice;

  /// 配送分钟
  int minute;

  /// 距离
  double distance;

  /// 优惠
  List<String> discount;

  StoreModel(
      {required this.headerImg,
      required this.storeName,
      required this.score,
      required this.monthSales,
      required this.avgPrice,
      required this.deliveryPrice,
      required this.minute,
      required this.distance,
      this.discount = const []});

  factory StoreModel.fromJson(Map<String, dynamic> json) =>
      _$StoreModelFromJson(json);

  Map<String, dynamic> toJson() => _$StoreModelToJson(this);

  @override
  String toString() {
    return toJson().toString();
  }
}

class CategoryStore {
  String name;
  List<CategoryStore> children;

  CategoryStore({required this.name, this.children = const []});
}
